﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Media;
using System.IO;

namespace RRRSRoguelike.Managers
{
    public class SoundManager
    {

        private Dictionary<string, SoundPlayer>sounds;

        public SoundManager() 
        {
            sounds = new Dictionary<string, SoundPlayer>();
        }

        public void AddSound(string key, string path) 
        {
            sounds.Add(key, new SoundPlayer());
            sounds[key].SoundLocation = path;
        }
        
        public void AddCustomSound(string key, string fileName)
        {
        	sounds.Add(key, new SoundPlayer());
            sounds[key].SoundLocation = Path.Combine(Properties.Settings.Default.CustomFolder,
        	                                         @"Sound\",fileName);
        }

        public void PlaySound(string sound)
        {
            if (Properties.Settings.Default.SoundToggle)
            {
                
                sounds[sound].Play();
            }
        }

    }
}
